<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>风味-反馈</title>
		<link rel="stylesheet" type="text/css" href="css/personCenterPublic.css"/>
		<style type="text/css">
			input[type=button]{width: 100%;position: fixed;bottom: 0;left:0; height: 50px;background: #d1d1d1;color: white;
			font-size: 18px;border: none;}
			input[type=button]:focus{outline: none;}
			textarea{width: 100%;margin-top: 100px;}
		</style>
		<script src="js/jquery-2.1.0.js"></script>

	</head>
	<body>
		<div id="back" >
			<a href="help.html"><&nbsp;返回帮助</a>
		</div>
		<div id="advicediv">
				<textarea name="advicecon" id="advicecon" rows="15" value="" maxlength="120" placeholder="如果在使用过程中有任何不便，请写下您对我们的意见或建议,字数限制在120字以内"></textarea>
			<input type="button" name="advicesub" id="advicesub" value="提交" disabled="disabled" />
		</div>
		<script>
			function getUrl(){
				var str = location.href;//获取传过来的地址
				var arr = str.split("?");
				var str1 = arr[1];//获取？之后的内容
				userId = str1.split("=")[1];
				return userId;
			}
			$(function(){

				var adviceSub=$("#advicesub");
				adviceSub.click(function(){
					var adviceCon=$("#advicecon").val();
					alert(adviceCon)
					$.ajax("/fengwei/help/setRecord",{
						type:"post",
						data:{
							'feedbackContent':adviceCon,
							'userId':getUrl
						},
						success:function(){
							alert(1)
						},
						error:function(){
							alert(0)
						}
					})

				})
			})

		</script>
		<script type="text/javascript">
			var adviceCon=document.getElementById('advicecon');
			var adviceSub=document.getElementById('advicesub');
			adviceCon.oninput=function(){
				if(adviceCon.value!=''){
					adviceSub.style.background='#FFCC33';
					adviceSub.disabled=false;
				}else{
					adviceSub.style.background='#d1d1d1';
					adviceSub.disabled=true;
				}
			}
			
			adviceSub.onclick=function(){
				alert('感谢您使用本软件，我们将因您而更加完善！');
			}
		</script>
	</body>
</html>
